package BLC

import (
	"bytes"
	"kongyixueyuan.com/publicChain/part57-wallets-input-output-update/BLC"
)

type TXInput struct {
	//1. 交易的Hash
	TxHash []byte

	//2. 存储TXOutput在Vout里面的索引
	Vout int

	Signature []byte // 数字签名

	PublicKey []byte // 公钥，钱包里面


}

//判断当前的消费是谁的钱
func (txInput *TXInput) UnLockWithAddress(ripemd160Hash []byte) bool  {

	publickKey := BLC.Ripemd160Hash(txInput.PublicKey)

	return bytes.Compare(publickKey,ripemd160Hash) ==0
}

